import { createBrowserRouter } from "react-router-dom";
import Main from "@/views/main";
import Home from "@/views/home";
import Login from "@/views/login";
import Absent from "@/views/absent";
import MyAbsent from "@/views/absent/components/my";
import SubAbsent from "@/views/absent/components/sub";

import Inform from "@/views/inform";
import PublishInform from "@/views/inform/components/publish";
import ListInform from "@/views/inform/components/list";

import Staff from "@/views/staff";
import AddStaff from "@/views/staff/components/add";
import ListStaff from "@/views/staff/components/list";
export const routes = [
  {
    path: "/",
    element: <Main />,
    children: [
      {
        path: "/home",

        element: <Home />,
      },
      {
        path: "/absent",
        element: <Absent />,
        children: [
          {
            path: "my",
            element: <MyAbsent />,
          },
          {
            path: "sub",
            element: <SubAbsent />,
          },
        ],
      },
      {
        path: "/inform",
        element: <Inform />,
        children: [
          {
            path: "publish",
            element: <PublishInform />,
          },
          {
            path: "list",
            element: <ListInform />,
          },
        ],
      },
      {
        path: "/staff",
        element: <Staff />,
        children: [
          {
            path: "add",
            element: <AddStaff />,
          },
          {
            path: "list",
            element: <ListStaff />
          },
        ],
      },
    ],
  },
  {
    path: "/login",
    element: <Login />,
  },
];

export default createBrowserRouter(routes);
